<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/*
 * Created on 2012-7-23
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
 if(!defined('ADMIN_URL')){
	define('ADMIN_URL',base_url().'application/views/admin/');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php  echo common::_get_setting('blog_title')?></title>
<link style="text/css" href="<?php echo ADMIN_URL;?>css/base.css" rel="stylesheet"/>
<link style="text/css" href="<?php echo ADMIN_URL;?>css/style.css" rel="stylesheet"/>
<script src="<?php echo ADMIN_URL;?>js/jquery.min.js"></script>
<script type='text/javascript'>
$(function(){

	$.ajax({
		url:"<?php echo ADMIN_URL.'files/menus/1.xml'?>",
		type:'POST',
		dateType:'xml',
		timeout:1000,
		cache:true,
		error:function(xml){
			alert('加载XML文档出错');
		},
		success:function(xml){
			var menus = $("<ul id='menu_li'></ul>");

			$(xml).find('Menu').each(function(){
				var menu_list = $("<li class='menu_list'></li>");
				var	sub_menu = $("<ul class='sub_menu'></ul>");

				//加载sub_menu
				$(this).children('link').each(function(){
					$(sub_menu).append("<li><a href='"+$(this).attr('href')+"'>"+$(this).attr('title')+"</a></li>");
				});

				//加载到menu_list
				$(menu_list).append("<a href='' class='menu'>"+$(this).attr('title')+"</a>").append($(sub_menu));


				//加载到menu_li
				$(menus).append($(menu_list));

			});

			$(menus).appendTo($('#nav'));
			$('#welcome').appendTo($('#menu_li'));
		}
	})
	$('#welcome').show();
})
</script>
</head>
<body>
	<div class='head w960'>
		<div id="nav">
		<li id='welcome' style="float:right;">
				欢迎你:
				<a href='' style='color:white;' title='用户中心' >admin</a>
				<a href='<?php echo site_url().'/admin/checklogin/logout'?>' style='color:white;' id='logout' title='退出'>退出</a>
		</li>
		</div>
	</div>

